package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/shop")
@Api(tags = "用户查询店铺信息")
@Slf4j
public class ShopUserController {
    public static final String statusKey = "SHOP_STATUS";

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 用户查询店铺状态
     * @param
     * @return
     */
    @GetMapping("/status")
    @ApiOperation("用户查询店铺状态")
    public Result getStatus() {
        log.info("用户查询店铺状态");
        Integer o = (Integer)redisTemplate.opsForValue().get(statusKey);
        return Result.success(o);
    }
}
